//构造函数  constructor
function Person(name, age) {
    //用new的方式调用的话
    console.log(this);
    this.name = name;
    this.age = age;
}
Person.prototype.sayHi = function() {    //prototype --属性
    console.log('Hello');
}
Person.prototype.playbasketball = function() {
    console.log('打篮球');
}

//用new 来调用的
const wf = new Person('王飞', 18);
console.log(wf.name);
wf.sayHi();
wf.playbasketball();